package com.e.takeaway.service;

import com.e.takeaway.po.Food;
import com.e.takeaway.po.MerChant;
import com.e.takeaway.po.Order;
import com.e.takeaway.po.User;

import java.util.List;
import java.util.Map;

import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;
import retrofit2.http.Query;

public interface RequestService {

    //主页请求数据
    @GET("getMerchant/{num}")
    Call<List<MerChant>> getList(@Path("num") int num);

    //商品详情页面
    @GET("getFoodList/{Id}")
    Call<List<Food>> getFoodList(@Path("Id") int Id);

    //登录
    @GET("getUser/{phone}/{password}")
    Call<User> getUser(@Path("phone")String phone,@Path("password")String password);

    //修改密码
    @GET("update/{phone}/{password}")
    Call<Integer> updatePwd(@Path("phone")String phone, @Path("password")String pwd);

    //搜索
    @GET("getSearch/{keyWord}")
    Call<List<MerChant>> getSearchMerchant(@Path("keyWord")String keyWord);

    //生成订单
    @POST("insertOrder")
    Call<Integer> pay(@Body Map<String, Object> pam1);

    @GET("getOder/{phone}")
    Call<List<Order>> getOrderList(@Path("phone")String phone);


}
